To filter data based on a single, static criteria through the creation of a simple document which displays a list of discontinued products.
Suppose you are required to create a document which lists all of your companies discontinued products so that you can clear out the inventory. AutoTag and the OData Wizard allow you to do just that by creating a filter to find all discontinued products. Here, we won’t show you the actual template creation as you can learn this in several other tutorials such as the ForEach Tag tutorial.
Start this tutorial with a blank template already connected to an OData datasource. If you don’t know how to do this, or haven’t set up an OData datasource in the past, please check out our Connecting to OData tutorial.
Since this tutorial works in the OData Wizard, we need it open. To open it, simply insert a ForEach tag (after making sure the document has a OData datasource) and click the Wizard button in the AutoTag ribbon, or check out the OData - Part 1: Basic Selection tutorial.
The steps to select data are the same here as in Part 1 of the OData Wizard tutorial series. First you need to drag the resource, which is Products in this case.
Then you need to drag the properties to the select box. We are using ProductName and Discontinued.
Now we want to add the filter. In the OData Wizard, to add filters, you have to click the statement click here to add a group first, and then you will see click here to add a filter. Click there now.
Once you have a filter, you simply need to set the properties so the filter knows what it is filtering. Click onclick here to select a node and select the Discontinued column from the Products table.
Next, click on click here to set the value to set a value to compare Discontinued to. Since we want to see Discontinued products, type True here (with a capital T; OData Wizard is case sensitive in this case). And that’s it. Creating a filter is that easy!
Of course you probably want to see what kind of output is returned when this filter is applied. You may have already noticed, but you can easily see this in the right side of the window.
You have completed this tutorial. We recommend taking a look at the OData - Part 4: Filtering with Variable Values tutorial next!